package com.bjpowernode.controllers;

import com.bjpowernode.entities.TDicValue;
import com.bjpowernode.result.Result;
import com.bjpowernode.services.DicValueService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DicController {
    @Resource
    private DicValueService dicValueService;

    @GetMapping(value = "/api/dic/{typeCode}")
    public Result getDicValueByTypeCode(@PathVariable(value = "typeCode") String typeCode) {
        List<TDicValue> tDicValue = dicValueService.getDicValueByTypeCode(typeCode);
        return Result.OK(tDicValue);
    }
}
